{layout name="layout" $title/}
<div class="container">
	<div class="col-md-8">
		<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
		  <!-- Indicators -->
			<ol class="carousel-indicators">
				<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
				<li data-target="#carousel-example-generic" data-slide-to="1"></li>
				<li data-target="#carousel-example-generic" data-slide-to="2"></li>
			</ol>
		  <!-- Wrapper for slides -->
			<div class="carousel-inner" role="listbox">
				<div class="item active">
					<img src="/static/img/desert.jpg" alt="...">
					<div class="carousel-caption">
						...
					</div>
				</div>
				<div class="item">
					<img src="/static/img/Penguins.jpg" alt="...">
					<div class="carousel-caption">
						...
					</div>
				</div>
				<div class="item">
				    <img src="/static/img/Tulips.jpg" alt="...">
					<div class="carousel-caption">
						...
					</div>
				</div>
			</div>
		  <!-- Controls -->
			<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
				<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
				<span class="sr-only">Previous</span>
			</a>
			<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
				<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
				<span class="sr-only">Next</span>
			</a>
		</div>
	</div>
	<div class="col-md-4 ">
		<form id="login-form" class="form-horizontal" method="post" action="{:url('index/index/login_msg')}" enctype="multipart/form-data">
			<div class="form-group">
				<laber for="username">请输入用户名</laber>
				<input type="text" class="form-control" name='user_code' id="user_code" value="{$Request.session.user_code}"/>
			</div>
		  <div class="form-group">
				<laber for="username">姓  名</laber>
				<input type="text" class="form-control" name='title' id="title" readonly/>
			</div>
			<div class="form-group">
				<laber for="passwd">请输入密码</laber>
				<input type="password" class="form-control" id="password" name="password" value="{$Request.session.user_password}"/>
			</div>
			<div class="checkbox">
				<label for=""><input type="checkbox" name="remember" value="1" {$Request.session.remember==1?='checked'}/>记住密码</label>
			</div>
			<button type="submit" class="btn btn-info btn-block">登录</button>
		</form>
	</div>
</div>
<!-- 使用Ajax来获取登录用户的姓名 -->
<script>
  $("#user_code").bind("focusout",function () {
    var data = {};
    data.user_code = $("input[name=user_code]").val();
    $.post("{:url('index/index/hello')}","user_code="+data.user_code,function(msg){
       $("#title").val(msg) 
    })
  })
</script>